//
//  AudioPlayer.h
//  LO_MUSIC
//
//  Created by 胡林 on 16/2/26.
//  Copyright © 2016年 杨少锋. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol AudioPlayerDelegate <NSObject>
//播放结束执行的协议
-(void)playFinish;
//没0.1秒执行一次的协议
//time当前的时间
-(void)playWithTime:(CGFloat)time;
@end

@interface AudioPlayer : NSObject
//1. 文件是单例
+(instancetype)shareAudioPlayer;


//2. 播放
-(void)plauWithurl:(NSString * )url;

//3. 暂停/恢复
-(void)playOrPause;

//4. 停止
-(void)stop;

//5. 从什么时候开始播放
-(void)seekoWithTime:(CGFloat)time;

//6. 设置音量
//7. 获取音量
@property (nonatomic,assign)CGFloat volume;

//8. 是否正在播放
@property (nonatomic ,assign,getter=isPlaying,readonly)BOOL playing;
//使用weak防止循环引用
@property (nonatomic ,weak)id<AudioPlayerDelegate>delegate;

@end
